/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ee.cybertron.energon.model;

import java.io.Serializable;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author stevenziggiz
 */
@Entity
@Table(name = "prime", catalog = "cybertron", schema = "", uniqueConstraints = {
    @UniqueConstraint(columnNames = {"description"})})
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Prime.findAll", query = "SELECT p FROM Prime p"),
    @NamedQuery(name = "Prime.findByIdprime", query = "SELECT p FROM Prime p WHERE p.idprime = :idprime"),
    @NamedQuery(name = "Prime.findByDescription", query = "SELECT p FROM Prime p WHERE p.description = :description")})
public class Prime implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idprime", nullable = false)
    private Integer idprime;
    @Basic(optional = false)
    @Column(name = "description", nullable = false, length = 45)
    private String description;
    @Basic(optional = false)
    @Lob
    @Column(name = "prime", nullable = false)
    private byte[] prime;

    public Prime() {
    }

    public Prime(Integer idprime) {
        this.idprime = idprime;
    }

    public Prime(Integer idprime, String description, byte[] prime) {
        this.idprime = idprime;
        this.description = description;
        this.prime = prime;
    }

    public Integer getIdprime() {
        return idprime;
    }

    public void setIdprime(Integer idprime) {
        this.idprime = idprime;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public byte[] getPrime() {
        return prime;
    }

    public void setPrime(byte[] prime) {
        this.prime = prime;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idprime != null ? idprime.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Prime)) {
            return false;
        }
        Prime other = (Prime) object;
        if ((this.idprime == null && other.idprime != null) || (this.idprime != null && !this.idprime.equals(other.idprime))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.ee.cybertron.energon.model.Prime[ idprime=" + idprime + " ]";
    }
    
}
